Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: upgrade dependencies #297

Closed

Conversation

Harshit933
Copy link
Collaborator

LDK 0.0.123 -> 0.0.125
bitcoin 0.30 -> 0.32 (as LDK uses 0.32)
bitcoincore_rpc 0.17 -> 0.19

@Harshit933
Copy link
Collaborator Author

This is work in progress

error[E0277]: the trait bound `HexIterator<'_>: bitcoincore_rpc::bitcoin::bitcoin_io::Read` is not satisfied
   --> lampo-core-wallet/src/lib.rs:276:50
    |
276 |         let object = Decodable::consensus_decode(&mut reader)?;
    |                      --------------------------- ^^^^^^^^^^^ the trait `bitcoincore_rpc::bitcoin::bitcoin_io::Read` is not implemented for `HexIterator<'_>`
    |                      |
    |                      required by a bound introduced by this call
    |
    = help: the following other types implement trait `bitcoincore_rpc::bitcoin::bitcoin_io::Read`:
              &File
              &Stdin
              &TcpStream
              &UnixStream
              &[u8]
              Arc<File>
              BufReader<R>
              ChildStderr
            and 19 others
note: required by a bound in `bitcoincore_rpc::bitcoin::consensus::Decodable::consensus_decode`
   --> /home/harshit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitcoin-0.32.4/src/consensus/encode.rs:371:28
    |
371 |     fn consensus_decode<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Error> {
    |                            ^^^^ required by this bound in `Decodable::consensus_decode`

warning: unreachable pattern
  --> lampo-core-wallet/src/lib.rs:87:13
   |
87 |             _ => unreachable!(),
   |             ^
   |
   = note: `#[warn(unreachable_patterns)]` on by default

warning: use of deprecated method `lampo_common::backend::Transaction::txid`: txid has been renamed to compute_txid to note that it's computationally expensive.  use compute_txid() instead.
   --> lampod/src/actions/handler.rs:195:76
    |
195 |                 log::info!("funding transaction created `{}`", transaction.txid());
    |                                                                            ^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated method `lampo_common::backend::Transaction::txid`: txid has been renamed to compute_txid to note that it's computationally expensive.  use compute_txid() instead.
   --> lampod/src/ln/channel_manager.rs:151:127
    |
151 |                         log::info!(target: "channel_manager", "confirmed transaction with txid `{}` at height `{height}`", tx.txid());
    |                                                                                                                               ^^^^

For more information about this error, try `rustc --explain E0277`.
warning: `lampo-core-wallet` (lib) generated 1 warning
error: could not compile `lampo-core-wallet` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
warning: use of deprecated method `lampo_common::backend::Transaction::txid`: txid has been renamed to compute_txid to note that it's computationally expensive.  use compute_txid() instead.
   --> lampod/src/ln/channel_manager.rs:435:44
    |
435 |         let txid = tx.as_ref().map(|tx| tx.txid());
    |                                            ^^^^

error[E0277]: the `?` operator can only be used on `Result`s in a method that returns `Result`
  --> lampod/src/ln/offchain_manager.rs:88:87
   |
85 |     pub fn decode_invoice(&self, invoice_str: &str) -> error::Result<ldk::invoice::Bolt11Invoice> {
   |     --------------------------------------------------------------------------------------------- this function returns a `Result`
...
88 |             .map_err(|err| error::bail!("Error occured while decoding invoice {err}"))?;
   |                                                                                       ^ this `?` produces `Result<Infallible, Result<_, lampo_common::error::Error>>`, which is incompatible with `Result<Bolt11Invoice, lampo_common::error::Error>`
   |
   = help: the trait `StdError` is not implemented for `Result<Bolt11Invoice, lampo_common::error::Error>`, which is required by `Result<Bolt11Invoice, lampo_common::error::Error>: FromResidual<Result<Infallible, Result<_, lampo_common::error::Error>>>`
   = help: the following other types implement trait `FromResidual<R>`:
             <Result<T, F> as FromResidual<Result<Infallible, E>>>
             <Result<T, F> as FromResidual<Yeet<E>>>
   = note: required for `lampo_common::error::Error` to implement `From<Result<_, lampo_common::error::Error>>`
   = note: required for `Result<Bolt11Invoice, lampo_common::error::Error>` to implement `FromResidual<Result<Infallible, Result<_, lampo_common::error::Error>>>`

error[E0271]: expected `{[email protected]:253:29}` to be a closure that returns `Result<(), ReplayEvent>`, but it returns `()`
   --> lampod/src/lib.rs:269:13
    |
267 |         let background_processor = BackgroundProcessor::start(
    |                                    -------------------------- required by a bound introduced by this call
268 |             self.persister.clone(),
269 |             event_handler,
    |             ^^^^^^^^^^^^^ expected `Result<(), ReplayEvent>`, found `()`
    |
    = note:   expected enum `Result<(), ReplayEvent>`
            found unit type `()`
    = note: required for `{closure@lampod/src/lib.rs:253:29: 253:48}` to implement `lampo_common::ldk::events::EventHandler`
note: required by a bound in `BackgroundProcessor::start`
   --> /home/harshit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lightning-background-processor-0.0.125/src/lib.rs:913:17
    |
904 |     pub fn start<
    |            ----- required by a bound in this associated function
...
913 |         EH: 'static + EventHandler + Send,
    |                       ^^^^^^^^^^^^ required by this bound in `BackgroundProcessor::start`

error[E0277]: the trait bound `LampoLogger: APeerManager` is not satisfied
   --> lampod/src/lib.rs:274:13
    |
267 |         let background_processor = BackgroundProcessor::start(
    |                                    -------------------------- required by a bound introduced by this call
...
274 |             self.logger.clone(),
    |             ^^^^^^^^^^^^^^^^^^^ the trait `APeerManager` is not implemented for `LampoLogger`
    |
    = help: the trait `APeerManager` is implemented for `PeerManager<Descriptor, CM, RM, OM, L, CMH, NS>`
note: required by a bound in `BackgroundProcessor::start`
   --> /home/harshit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lightning-background-processor-0.0.125/src/lib.rs:941:15
    |
904 |     pub fn start<
    |            ----- required by a bound in this associated function
...
941 |         PM::Target: APeerManager + Send + Sync,
    |                     ^^^^^^^^^^^^ required by this bound in `BackgroundProcessor::start`

error[E0061]: this function takes 9 arguments but 8 arguments were supplied
   --> lampod/src/lib.rs:267:36
    |
267 |           let background_processor = BackgroundProcessor::start(
    |  ____________________________________^^^^^^^^^^^^^^^^^^^^^^^^^^-
268 | |             self.persister.clone(),
269 | |             event_handler,
270 | |             self.channel_manager().chain_monitor(),
271 | |             self.channel_manager().manager(),
272 | |             GossipSync::p2p(gossip_sync),
    | |             ---------------------------- expected `std::option::Option<_>`, found `GossipSync<Arc<P2PGossipSync<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoChainManager>, Arc<LampoLogger>>>, &lightning_rapid_gossip_sync::RapidGossipSync<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>>, Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoChainManager>, Arc<LampoLogger>>`
273 | |             self.peer_manager().manager(),
    | |             ----------------------------- unexpected argument of type `Arc<PeerManager<lampo_common::ldk::lightning_net_tokio::SocketDescriptor, Arc<ChannelManager<Arc<ChainMonitor<InMemorySigner, Arc<(dyn lampo_common::ldk::chain::Filter + std::marker::Send + std::marker::Sync + 'static)>, Arc<LampoChainManager>, Arc<LampoChainManager>, Arc<LampoLogger>, Arc<FilesystemStore>>>, Arc<LampoChainManager>, Arc<LampoKeysManager>, Arc<LampoKeysManager>, Arc<LampoKeysManager>, Arc<LampoChainManager>, Arc<DefaultRouter<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>, Arc<LampoKeysManager>, Arc<std::sync::Mutex<ProbabilisticScorer<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>>>>, ProbabilisticScoringFeeParameters, ProbabilisticScorer<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>>>>, Arc<LampoLogger>>>, Arc<P2PGossipSync<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoChainManager>, Arc<LampoLogger>>>, Arc<OnionMessenger<Arc<LampoKeysManager>, Arc<LampoKeysManager>, Arc<LampoLogger>, Arc<EmptyNodeIdLookUp>, Arc<DefaultMessageRouter<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>, Arc<LampoKeysManager>>>, IgnoringMessageHandler, IgnoringMessageHandler, IgnoringMessageHandler>>, Arc<LampoLogger>, IgnoringMessageHandler, Arc<LampoKeysManager>>>`
274 | |             self.logger.clone(),
275 | |             Some(self.channel_manager().scorer()),
    | |             ------------------------------------- expected `GossipSync<_, _, _, _, Arc<LampoLogger>>`, found `std::option::Option<Arc<std::sync::Mutex<ProbabilisticScorer<Arc<NetworkGraph<Arc<LampoLogger>>>, Arc<LampoLogger>>>>>`
276 | |         );
    | |_________- two arguments of type `Arc<LampoLogger>` and `std::option::Option<_>` are missing
    |
note: associated function defined here
   --> /home/harshit/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lightning-background-processor-0.0.125/src/lib.rs:904:9
    |
904 |     pub fn start<
    |            ^^^^^
help: did you mean
    |
267 |         let background_processor = BackgroundProcessor::start(self.persister.clone(), event_handler, self.channel_manager().chain_monitor(), self.channel_manager().manager(), Some(self.channel_manager().scorer()), GossipSync::p2p(gossip_sync), self.logger.clone(), /* Arc<LampoLogger> */, /* scorer */);
    |                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some errors have detailed explanations: E0061, E0271, E0277.
For more information about an error, try `rustc --explain E0061`.
warning: `lampod` (lib) generated 5 warnings
error: could not compile `lampod` (lib) due to 4 previous errors; 5 warnings emitted

@vincenzopalazzo
Copy link
Owner

When you are done with this, can you do an update package per commit?

It is a blob change anyway, however, if you wait #292 this should be way simple because there are less packages that depends from rust-bitcoin

@Harshit933
Copy link
Collaborator Author

It is a blob change anyway, however, if you wait #292 this should be way simple because there are less packages that depends from rust-bitcoin

Yeah, I noticed that in 0.0.124 ldk update. I can wait on this, meanwhile I can review #292 .

@Harshit933
Copy link
Collaborator Author

Last steps rust-bitcoin/rust-bitcoin#3668

@Harshit933 Harshit933 marked this pull request as ready for review November 27, 2024 22:43
lightning 0.0.123 -> 0.0.125
bitcoin 0.30 -> 0.32
bitcoincore-rpc 0.17 -> 0.19
bitcoin-hashes 0.12 -> 0.15
@Harshit933
Copy link
Collaborator Author

Some tests are failing

test lampo_tests::init_connection_test_between_lampo ... ok
test lampo_cln_tests::no_able_to_pay_invoice_to_cln ... ok
test lampo_cln_tests::init_connection_test ... ok
test lampo_cln_tests::decode_invoice_from_cln ... ok
test lampo_tests::decode_offer ... FAILED
test lampo_cln_tests::test_close_channel_without_opening_a_channel_fails ... ok
test lampo_tests::pay_invoice_simple_case_lampo ... FAILED
test lampo_tests::pay_offer_minimal_offer ... FAILED
test lampo_cln_tests::decode_cln_offer_from_lampo ... FAILED
test lampo_cln_tests::decode_cln_offer_from_lampo_minimal_offer ... FAILED
test lampo_cln_tests::fund_a_simple_channel_to_lampo ... ok
test lampo_tests::fund_a_simple_channel_from ... FAILED
test lampo_cln_tests::test_lampo_to_cln_close_channel_with_channel_id_success ... FAILED
test lampo_cln_tests::payinvoice_to_lampo ... FAILED
test lampo_cln_tests::test_lampo_to_cln_close_channel_without_channel_id_success ... FAILED
test lampo_cln_tests::pay_invoice_to_cln ... FAILED
test lampo_cln_tests::test_closing_two_channels_without_channelid_fails ... FAILED
test lampo_cln_tests::fund_a_simple_channel_from_lampo ... FAILED
test lampo_tests::pay_offer_simple_case_lampo ... FAILED
test lampo_cln_tests::test_sync_gossip_from_network_cln ... ok
test lampo_cln_tests::be_able_to_kesend_payments ... FAILED

@Harshit933
Copy link
Collaborator Author

Fixed the tests

Copy link
Owner

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

I am added some basic comment, and I think this PR should be based in on the next branch because it is much cleaner.

Or you can build on top of the first comment of the following PR https://github.com/vincenzopalazzo/lampo.rs/pull/292/commits (ONLY the first commit, so you can cherry-pick it)

Comment on lines +118 to +120
other_key: &lightning::bitcoin::secp256k1::PublicKey,
tweak: Option<&lightning::bitcoin::secp256k1::Scalar>,
) -> Result<lightning::bitcoin::secp256k1::ecdh::SharedSecret, ()> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here we do not referer in this crate with lightning, it is wrong.

Please see how we use it in other part of the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -17,6 +17,7 @@ pub mod request {
pub use crate::model::getinfo::*;
pub use crate::model::invoice::request::*;
pub use crate::model::keysend::request::*;
#[allow(unused_imports)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong, why we are using it? you are suppressing warning and we should not do without a good reason

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The network request has nothing in it.

We could probably remove this, but then the request and response pattern would be non-uniform.

@Harshit933
Copy link
Collaborator Author

This is having many conflicts with the next branch if I am rebasing it (mainly because of main and next branch conflict), I'll reopen this

@Harshit933 Harshit933 closed this Nov 29, 2024
@Harshit933
Copy link
Collaborator Author

Opened in #314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants